package pl.edu.agh.neuraleconomy.ui.chart;

import java.io.File;
import java.io.IOException;

import org.apache.log4j.Logger;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;

public class ChartExporter {
	private static Logger logger = Logger.getLogger(ChartExporter.class);
	
	public static void export(JFreeChart chart, File file){
		try {
			ChartUtilities.saveChartAsJPEG(file, chart, 800, 600);
		} catch (IOException e) {
			logger.error("Nie udalo sie zapisac wykresu do pliku", e);
		}
	}
}
